//以下程序的运行结果：
class A{
	public void foo() {
		System.out.print("foo1");
	}
}

class B extends A{
	public void foo() {
		System.out.print("foo2");
	}
}

class C extends A{
	A _a;
	public C(A a){_a = a;}
	public void foo() {
		_a.foo();
		System.out.print("foo3");
	}
}

class T{
	public static void main(String []args){
		A a = new C(new B(){
			public void foo(){
				System.out.print("foo1");
			}
		});
		a.foo();
	}
}